package com.pomr.model.sys;


import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.GenericGenerator;

import com.auth0.jwt.internal.com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Entity
@Table(name="city")
@JsonIgnoreProperties(value={"province"})
public class City implements Serializable{
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Province getProvince() {
		return province;
	}
	public void setProvince(Province province) {
		this.province = province;
	}
	public String getEnabled() {
		return enabled;
	}
	public void setEnabled(String enabled) {
		this.enabled = enabled;
	}
	@Id
	@Column(name="id",length=6)
	@GeneratedValue(strategy = GenerationType.AUTO)
	@GenericGenerator(name = "paymentableGenerator", strategy = "assigned")//主键自己维护
	private String id;
	@Column(name="name",length=20)
	private String name;
	@ManyToOne(fetch=FetchType.LAZY)// 指定多对一           关联省表
	@JoinColumn(name="parentID")  
	private Province province ; //注意这个地方不要new对象，否则会无法运行 
	@Column(name="enabled",length=1,columnDefinition="varchar(1) default '1'")
	private String enabled;
	
	
}
